//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<class_id.h>
///	@path	~/src/object/
///	@date	2008/01/12
///	@desc	IObject's ClassID declarations.

#pragma once

#include "xeres.h"

namespace xeres {

	// forward declaration
	class ClassEntry;

	/*! 
		\ingroup iobject_module

		\typedef	ClassID
		\brief		Alias of internal class registration entry.
		\details	ClassID is a pointer, but we make it look like an ID to associate
					some identification algorithm on it.
	*/
	typedef ClassEntry * ClassID;

	/*! 
		\brief		Set a class data slot dynamically.
	*/
	bool RegisterClassSlot( ClassID id , const char * key , void * value );

	/*! 
		\brief		Delete a class data slot.
	*/
	bool DelClassSlot( ClassID id , const char * key );

	/*!	
		\brief		Get class slot.
	*/
	bool GetClassSlot( ClassID id , const char * key , void *& value );

	/*!	
		\brief		Set class slot.
	*/
	bool SetClassSlot( ClassID id , const char * key , void * value );

	/*!	
		\brief		Get class slot from this class or ancient class.
	*/
	bool GetInheritClassSlot( ClassID id , const char * key , void *& value );

	/*!
		\defgroup	IOBJECTBASICTYPE			IObject Basic Types
		\ingroup	iobject_module

		\brief		Defines basic type traits of IObject system.

		\details	The RTTI system of IObject not only supports IObject classes,
					but also supports basic value types.
		
		\sa IObject

		@{

		\defgroup	IOBJECTBASICTYPEGROUP		IObject Basic Type ID
		\ingroup	IOBJECTBASICTYPE

		\details	These IDs should not be assumed as usual Class IDs.
					They usually returned by IVar or its children to indicate
					value stored in dynamic variables.

		\brief		This ID is used to indicate basic types such as boolean or floats.

		\sa ClassID, IVar

		@{
	*/

	/// \def	INVALID_CLASS_ID
	/// \brief	Indicates invalid class ID.
#define	INVALID_CLASS_ID		((ClassID)0x00)

	/*!
		\defgroup	IOBJECTBASICTYPE_BASIC	Basic Type ID & Name Definition
		\ingroup	IOBJECTBASICTYPEGROUP

		\brief	Defines basic type class IDs & names, such as integer or floats.
		@{
	*/

	/// Class ID of 'void' type, only valid in function protocol. \sa #VOID_TYPE_CLASS_NAME
#define	VOID_TYPE_CLASS_ID		((ClassID)0x01)
	/// Class name of 'void' type. \sa VOID_TYPE_CLASS_ID
#define	VOID_TYPE_CLASS_NAME	(_S("VoidType"))

	/// Class ID of 'bool' type. \sa #BOOL_TYPE_CLASS_NAME
#define	BOOL_TYPE_CLASS_ID		((ClassID)0x02)
	/// Class name of 'bool' type. \sa BOOL_TYPE_CLASS_ID
#define	BOOL_TYPE_CLASS_NAME	(_S("BoolType"))

	/// Class ID of 'int' type. \sa #INT_TYPE_CLASS_NAME
#define	INT_TYPE_CLASS_ID		((ClassID)0x03)
	/// Class name of 'int' type. \sa INT_TYPE_CLASS_ID
#define	INT_TYPE_CLASS_NAME		(_S("IntType"))

	/// Class ID of 'float' type. \sa #FLOAT_TYPE_CLASS_NAME
#define	FLOAT_TYPE_CLASS_ID		((ClassID)0x04)
	/// Class name of 'float' type. \sa FLOAT_TYPE_CLASS_ID
#define	FLOAT_TYPE_CLASS_NAME	(_S("FloatType"))

	/// Class ID of 'pair' type. \sa #PAIR_TYPE_CLASS_NAME
#define	PAIR_TYPE_CLASS_ID		((ClassID)0x05)
	/// Class name of 'pair' type. \sa PAIR_TYPE_CLASS_ID
#define	PAIR_TYPE_CLASS_NAME	(_S("PairType"))

	/// Class ID of 'vector' type. \sa #VECTOR_TYPE_CLASS_NAME
#define	VECTOR_TYPE_CLASS_ID	((ClassID)0x06)
	/// Class name of 'vector' type. \sa VECTOR_TYPE_CLASS_ID
#define	VECTOR_TYPE_CLASS_NAME	(_S("VectorType"))

	/// Class ID of 'color' type. \sa #COLOR_TYPE_CLASS_NAME
#define	COLOR_TYPE_CLASS_ID		((ClassID)0x07)
	/// Class name of 'color' type. \sa COLOR_TYPE_CLASS_ID
#define	COLOR_TYPE_CLASS_NAME	(_S("ColorType"))

	/// Class ID of 'quat' type. \sa #QUAT_TYPE_CLASS_NAME
#define	QUAT_TYPE_CLASS_ID		((ClassID)0x08)
	/// Class name of 'quat' type. \sa QUAT_TYPE_CLASS_ID
#define	QUAT_TYPE_CLASS_NAME	(_S("QuatType"))

	/// Class ID of 'matrix' type. \sa #MATRIX_TYPE_CLASS_NAME
#define	MATRIX_TYPE_CLASS_ID	((ClassID)0x09)
	/// Class name of 'matrix' type. \sa MATRIX_TYPE_CLASS_ID
#define	MATRIX_TYPE_CLASS_NAME	(_S("MatrixType"))

	/// Class ID of 'string' type. \sa #STRING_TYPE_CLASS_NAME
#define	STRING_TYPE_CLASS_ID	((ClassID)0x10)
	/// Class name of 'string' type. \sa STRING_TYPE_CLASS_ID
#define	STRING_TYPE_CLASS_NAME	(_S("StringType"))

	/*! @} */

	/*!
		\defgroup	IOBJECTBASICTYPE_EXT		Extended Type ID & Name Definition
		\ingroup	IOBJECTBASICTYPEGROUP

		\brief	Defines extended type class IDs & names, types are also built-in, but not formal IOobject type.
		@{
	*/

	/// Class ID of 'array' type. \sa ARRAY_TYPE_CLASS_NAME
#define	ARRAY_TYPE_CLASS_ID		((ClassID)0x11)
	/// Class name of 'array' type. \sa ARRAY_TYPE_CLASS_ID
#define	ARRAY_TYPE_CLASS_NAME	(_S("ArrayType"))

	/// Class ID of 'list' type. \sa LIST_TYPE_CLASS_NAME
#define	LIST_TYPE_CLASS_ID		((ClassID)0x12)
	/// Class name of 'list' type. \sa LIST_TYPE_CLASS_ID
#define	LIST_TYPE_CLASS_NAME	(_S("ListType"))

	/// Class ID of 'dict' type. \sa DICT_TYPE_CLASS_NAME
#define	DICT_TYPE_CLASS_ID		((ClassID)0x13)
	/// Class name of 'dict' type. \sa DICT_TYPE_CLASS_ID
#define	DICT_TYPE_CLASS_NAME	(_S("DictType"))

	/// Class ID of 'set' type. \sa DICT_TYPE_CLASS_NAME
#define	SET_TYPE_CLASS_ID		((ClassID)0x13)
	/// Class name of 'set' type. \sa DICT_TYPE_CLASS_ID
#define	SET_TYPE_CLASS_NAME		(_S("SetType"))

	/*! @} */

	/*! @} */

	/*! @} */

} // namespace xeres
